import Vue from 'vue';
import Vuex from 'vuex';
import App from './App.vue';
import './assets/less/common.less';
import store from './store';

Vue.directive( 'focus', {
	inserted( el ) {
		el.focus();
	}
} );

const NotFound = {
	template: '<p>Page not found</p>'
}
const Home = {
	template: '<p>home page</p>'
}
const About = {
	template: '<p>about page</p>'
}

const routes = {
	'/': Home,
	'/about': About
}

new Vue( {
	el: '#app',
	store,
	// data() {
	// 	console.log( window.location.pathname )
	// 	return {
	// 		currentRoute: window.location.pathname
	// 	}
	// },
	// computed: {
	// 	viewComponent() {
	// 		console.log( this.currentRoute )
	// 		return routes[ this.currentRoute ] || NotFound
	// 	}
	// },
	render: function ( createElement ) {
		return createElement( 'app' )
		// console.log( this.currentRoute )
		// return createElement( this.viewComponent )
	},
	components: {
		app: App
	}
} );